package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.WxMiniprogramMapper;
import com.ruoyi.domain.WxMiniprogram;
import com.ruoyi.service.IWxMiniprogramService;

/**
 * miniprogramService业务层处理
 * 
 * @author zy
 * @date 2022-03-27
 */
@Service
public class WxMiniprogramServiceImpl implements IWxMiniprogramService 
{
    @Autowired
    private WxMiniprogramMapper wxMiniprogramMapper;

    /**
     * 查询miniprogram
     * 
     * @param id miniprogram主键
     * @return miniprogram
     */
    @Override
    public WxMiniprogram selectWxMiniprogramById(Long id)
    {
        return wxMiniprogramMapper.selectWxMiniprogramById(id);
    }

    /**
     * 查询miniprogram列表
     * 
     * @param wxMiniprogram miniprogram
     * @return miniprogram
     */
    @Override
    public List<WxMiniprogram> selectWxMiniprogramList(WxMiniprogram wxMiniprogram)
    {
        return wxMiniprogramMapper.selectWxMiniprogramList(wxMiniprogram);
    }

    /**
     * 新增miniprogram
     * 
     * @param wxMiniprogram miniprogram
     * @return 结果
     */
    @Override
    public int insertWxMiniprogram(WxMiniprogram wxMiniprogram)
    {
        wxMiniprogram.setCreateTime(DateUtils.getNowDate());
        return wxMiniprogramMapper.insertWxMiniprogram(wxMiniprogram);
    }

    /**
     * 修改miniprogram
     * 
     * @param wxMiniprogram miniprogram
     * @return 结果
     */
    @Override
    public int updateWxMiniprogram(WxMiniprogram wxMiniprogram)
    {
        wxMiniprogram.setUpdateTime(DateUtils.getNowDate());
        return wxMiniprogramMapper.updateWxMiniprogram(wxMiniprogram);
    }

    /**
     * 批量删除miniprogram
     * 
     * @param ids 需要删除的miniprogram主键
     * @return 结果
     */
    @Override
    public int deleteWxMiniprogramByIds(Long[] ids)
    {
        return wxMiniprogramMapper.deleteWxMiniprogramByIds(ids);
    }

    /**
     * 删除miniprogram信息
     * 
     * @param id miniprogram主键
     * @return 结果
     */
    @Override
    public int deleteWxMiniprogramById(Long id)
    {
        return wxMiniprogramMapper.deleteWxMiniprogramById(id);
    }
}
